home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 31
/
Amiga Format CD31 (1998-09-02)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1998-10].iso
/
-websites-
/
sasg
/
dfa
/
rexx
/
dif2dfa.lha
/
dif2dfa.dfa
Wrap
Text File
|
1995-04-30
|
2KB
|
83 lines
/* $Revision Header built automatically *************** (do not edit) ************
**
** © Copyright by Dirk Federlein
**
** File : dif2dfa.dfa
** Created on : Sonntag, 30.04.95 21:59:12
** Created by : Dirk Federlein
** Current revision : V1.0
**
**
** Purpose
** -------
** Import script for dif formatted files (e.g. 'Datamat')
**
** Revision V1.0
** --------------
** created on Sonntag, 30.04.95 21:59:12 by Dirk Federlein. LogMessage :
** --- Initial release ---
**
*********************************************************************************/
options results
tabchar = '09'X
cr = '0A'X
lf = '0D'X
quote = '22'X
delim = quote||tabchar||quote
importfile = 't:dfa_import.dif'
firstline = 1
if ~show(ports, DFA) then
do
exit 10
end
if open('outhandle', "CON:100/50/550/300/DFA<->Arexx/CLOSE/WAIT", 'RW') = 0 then
exit
if open('imfh',importfile,'R') then
do
address 'DFA'
linenumber = 0
do while eof('imfh') = 0
linenumber = linenumber+1
writech('outhandle', 'Parsing line #'linenumber ': ' )
InLine = readln('imfh')
if (index(InLine, (tabchar)) > 0) then
do
if firstline = 1 then
do
firstline = 0
parse var InLine FirstName (tabchar) LastName (tabchar) City (cr) (lf)
end
else
do
parse var InLine (lf) FirstName (tabchar) LastName (tabchar) City (cr) (lf)
end
writech('outhandle', FirstName LastName cr)
NEW 'FIRST="'FirstName'" NAME="'LastName'" CITY="'City'"'
end
else
do
writech('outhandle', '*** no data ***' cr)
end
end
close ('imfh')
end